<?php

namespace App\Http\Resources\AuthResources;

use App\Http\Resources\Resource;
use App\Models\PasswordProblem;

class AnswerResource extends Resource
{
    /**
     * Transform the resource collection into an array.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return array
     */
    public function toArray($request)
    {
        return [
            'problem_id' => $this->problem_id,
            'problem_name' => PasswordProblem::where('id', $this->problem_id)->value('name')
        ];
    }
}
